gusucode.com > ASP+ACCESS在线手机销售系统(论文+源代码+答辩PPT) > ASP+ACCESS在线手机销售系统(论文+源代码+答辩PPT)\9)ASP 在线手机销售系统\HandsetPro\handset\shopcart.asp
<!-- #include file = "include/conndb.asp"--> <!-- #include file = "include/config.asp"--> <!-- #include file = "include/memberbase.asp"--> <!-- #include file = "include/productbase.asp"--> <!-- #include file = "include/cartbase.asp"--> <HTML><HEAD> <!-- #include file = "include\head.asp"--> </HEAD> <BODY> <!-- 页头与菜单---> <TABLE align = center cellSpacing = 0 cellPadding = 0 width = "750" border = 0 ID = "tabMain" class = tabframe> <TBODY> <TR> <TD > <% ShowHeadAndMenu() %> </TD> </TR> </TBODY> </TABLE> <!-- 页面中间部分--> <TABLE align = center cellSpacing = 0 cellPadding = 0 width = "750" border = 0 height = "411" ID = "Table3" class = tabframe> <TBODY><TR> <!--左侧页面--> <TD vAlign = top align = middle width = 180 height = "411"> <table width = 95% ID = "Table1"><tr><td> <!-- #include file = "include/left.asp"--> </td></tr></table> </TD> <!--右侧页面--> <TD vAlign = top align = right height = "411"> <!-- 最新产品预览--> <TABLE cellSpacing = 0 borderColorDark = rgb(210,232,255) cellPadding = 0 width = "100%" bgColor = #666666 borderColorLight = #aaaaaa border = 1 ID = "Table2"> <TBODY><TR> <TD> <TABLE cellSpacing = 0 cellPadding = 0 width = "100%" bgColor = #ffffff border = "0" style = "border-collapse: collapse" bordercolor = "#111111" ID = "Table5"> <TBODY> <TR> <TD > <% dim reqProductID, reqClear,reqModify dim products, tempQuantity dim i, j dim Head '读取参数 reqProductID = Request.QueryString("productID") '此句可以排除reqProductID为空和是非数字的情况 if Not IsNumeric(reqProductID) then reqProductID = "0" ResPonse.Write "您所选够的商品不存在,请重试……" Response.End end if reqClear = Request.QueryString("clear") reqModify = Request.Form("Modify") '如果reqProductID有效,刚将它加入到购物车 if reqProductID <> "0" then PutToCart reqProductID, "1" end if Head = "以下是您所选购的物品清单" '如果是清空购物车命令,刚清空购物车 If reqClear = "yes" Then Session("productList") = "" Session("quantityList") = "" End If '如果单击了“确认修改”,则按照当前设置重新装载购物车 If reqModify = "Yes" Then Session("productList") = "" Session("quantityList") = "" '此处Form中的productID为每个商品对应的复选框 '注意这里明确使用Request.QueryString和Request.Form的作用 '如果从表单提交的以个以上的同名参数,则值之间以英文逗号分隔 products = Split(Request.Form("productID"), ", ") For I = 0 To UBound(products) j = UBound(products)-i tempQuantity = Request.Form("quantity"&products(j)) if tempQuantity = "" then tempQuantity = 1 PutToCart products(j), tempQuantity Next End If 'Response.Write Session("productList") 'Response.Write "<br><br>" 'Response.Write Session("quantityList") 'Response.Write "<br><br>" '显示购物车 call ShowCart() %> </TD> </TR></TBODY></table> </TD> </TR></TBODY></TABLE> </TD><!-- 右侧页面结束--> </TR></TBODY></TABLE><!--页面中间部分结束--> <!--页尾--> <!-- #include file = "include/foot.asp"--> </BODY> </HTML>